<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" MasterPageFile="~/main.master" Inherits="adm_sc_categories_Default" %>

<asp:Content ID="hd" ContentPlaceHolderID="HeadContent" runat="server">
    <title>
       Administration | Manage Categories</title>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MC" runat="server">
    <div class="top_heading">
        <h3>
            Manage Categories</h3>
    </div>
    <div class="separator_10px">
    </div>
    <asp:UpdateProgress ID="UpdateProgress2" runat="server">
        <ProgressTemplate>
            <div class="item_pad_4_c">
                <img src="<%=  Config.GetUrl("images/loading.gif") %>" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="server" RenderMode="Inline">
        <ContentTemplate>
            <div id="msg" runat="server">
            </div>
            <div class="item_pad_2">
                <div id="bx1">
                    <div class="bx_hd">
                        <b>List of Categories</b>
                    </div>
                    <div class="bx_bd2">
                        <div class="item_pad_4_c">
                            <a href="Process.aspx" class="bld">Add Category</a>
                        </div>
                        <div class="item">
                            <div class="item_pad_2">
                                <div class="field_item_left">
                                    Search:
                                </div>
                                <div class="field_item_right">
                                    <asp:TextBox ID="txt_search" SkinID="nm_txtbox" MaxLength="100" Width="300" runat="server"></asp:TextBox>&nbsp;
                                    <asp:Button ID="btn_search" runat="server" Text="Search" OnClick="btn_search_Click" />
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div class="item_pad_2">
                                <div class="field_item_left">
                                    Filter Records:
                                </div>
                                <div class="field_item_right">
                                    <asp:DropDownList ID="drp_filter" OnSelectedIndexChanged="drp_filter_SelectedIndexChanged"
                                        AutoPostBack="true" runat="server">
                                        <asp:ListItem Text="General" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="Videos" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="Channels" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="Abuse Types" Value="4"></asp:ListItem>
                                        <asp:ListItem Text="Classified" Value="13"></asp:ListItem>
                                        <asp:ListItem Text="Directories" Value="14"  Selected="True"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div class="item_pad_2">
                                <div class="field_item_left">
                                    Select Status:
                                </div>
                                <div class="field_item_right">
                                    <asp:DropDownList ID="drp_fstatus" AutoPostBack="true" runat="server" OnSelectedIndexChanged="drp_fstatus_SelectedIndexChanged">
                                        <asp:ListItem Text="All" Value="2" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Public" Value="0"></asp:ListItem>
                                        <asp:ListItem Text="Private" Value="1"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                            <div class="item_pad_2">
                                <div class="field_item_left">
                                    Order:
                                </div>
                                <div class="field_item_right">
                                    <asp:DropDownList ID="drp_order" AutoPostBack="true" runat="server" OnSelectedIndexChanged="drp_order_SelectedIndexChanged">
                                        <asp:ListItem Text="Category Name DESC" Value="categoryname desc" Selected="True"></asp:ListItem>
                                        <asp:ListItem Text="Category Name ASC" Value="categoryname asc"></asp:ListItem>
                                        <asp:ListItem Text="Priority DESC" Value="priority desc"></asp:ListItem>
                                        <asp:ListItem Text="Priority ASC" Value="priority asc"></asp:ListItem>
                                        <asp:ListItem Text="isPrivate" Value="isprivate desc"></asp:ListItem>
                                        <asp:ListItem Text="CategoryID DESC" Value="categoryid desc"></asp:ListItem>
                                        <asp:ListItem Text="CategoryID ASC" Value="categoryid asc"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                                <div class="clear">
                                </div>
                            </div>
                        </div>
                        <asp:Panel ID="pnl_main" runat="server">
                            <div class="item">
                                <asp:DataList ID="MyList" Width="100%" CssClass="tdivupper" RepeatColumns="1" RepeatDirection="Vertical"
                                    runat="server" OnItemDataBound="MyList_ItemDataBound">
                                    <HeaderTemplate>
                                        <table class="tdiv">
                                            <tr>
                                                <th width="15%">
                                                    CategoryID
                                                </th>
                                                <th width="35%">
                                                    Category Name
                                                </th>
                                                <th width="35%">
                                                    Term
                                                </th>
                                                <th width="15%">
                                                    ...
                                                </th>
                                            </tr>
                                        </table>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <table class="tdiv">
                                            <tr>
                                                <td style="width: 15%;">
                                                    <asp:Label ID="lbl_categoryid" runat="server" Text='<%# ((Category_Struct)Container.DataItem).ID %>' />
                                                    <asp:Label ID="lbl_type" runat="server" Text='<%# ((Category_Struct)Container.DataItem).Type %>'
                                                        Visible="false" />
                                                </td>
                                                <td style="width: 35%;">
                                                    <asp:Label ID="lbl_categoryname" runat="server" Text='<%# ((Category_Struct)Container.DataItem).Name %>' />
                                                </td>
                                                <td style="width: 35%;">
                                                    <asp:Label ID="lbl_term" runat="server" Text='<%# ((Category_Struct)Container.DataItem).Term %>' />
                                                </td>
                                                <td style="width: 10%;">
                                                    <asp:HyperLink ID="lnk_edit" runat="server">Edit</asp:HyperLink>&nbsp;
                                                    <asp:HyperLink ID="lnk_delete" runat="server">Delete</asp:HyperLink>
                                                </td>
                                            </tr>
                                        </table>
                                    </ItemTemplate>
                                </asp:DataList>
                            </div>
                            <div class="pagination_item">
                                <asp:LinkButton ID="lnk_Prev" CssClass="pagination_link" runat="server" Text="Prev"
                                    OnClick="lnk_Prev_Click"></asp:LinkButton>
                                <asp:Repeater ID="rptPages" runat="server" OnItemCommand="rptPages_ItemCommand" OnItemDataBound="rptPages_ItemDataBound">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnPage" CommandName="Page" CommandArgument="<%# Container.DataItem %>"
                                            Text='<%# Container.DataItem %>' runat="server"></asp:LinkButton>&nbsp;
                                    </ItemTemplate>
                                </asp:Repeater>
                                <asp:LinkButton ID="lnk_Next" runat="server" CssClass="pagination_link" Text="Next"
                                    OnClick="lnk_Next_Click"></asp:LinkButton>
                            </div>
                        </asp:Panel>
                        <asp:Panel ID="pnl_norecord" runat="server">
                            <div class="box">
                                <div class="box_b">
                                    <div class="separator_10px">
                                    </div>
                                    <div class="separator_10px">
                                    </div>
                                    <div class="item_pad_4_c">
                                        <h4>
                                            No Category Found!</h4>
                                    </div>
                                    <div class="separator_10px">
                                    </div>
                                    <div class="separator_10px">
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
